{% extends "base.volt" %}
		{% block pageHeader %}
        {{ stylesheet_link("/libs/bootstrap-daterangepicker/daterangepicker.css", false) }}
        {% endblock %}

        {% block pageFooter%}
        {{ javascript_include("/libs/UEditor/utf8-php/ueditor.config.js", false) }}
        {{ javascript_include("/libs/UEditor/utf8-php/ueditor.all.min.js", false) }}
        {{ javascript_include("/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js", false) }}
        {{ javascript_include("/libs/UEditor/utf8-php/addCustomizeButton.js", false) }}
		{{ javascript_include("/assets/manage/js/beautycanon/list_edit_base.js", false) }}
        {% endblock %}

        {% block content %}
        {{ partial("module/left_beautycanon") }}
<div class="col-xs-10">
		<ol class="breadcrumb">
            <li>美粒宝典</li>
            <li class="active">添加美粒宝典</li>
        </ol>       
<div class="container-fluid" id="content_box_blank">
    <div class="row">
        <div class="col-xs-12">
            <form id="form_update" class="form-horizontal" durl="{{url.get('beautycanon/list',['state':2])}}" role="form" method="post" durl="<?=$action?>" action="" target="ifr_send_file" enctype="multipart/form-data">
			<input type="hidden" name="callback" value="parent.setFormResult">
            <div class="row form-group">
                <label class="col-xs-2 control-label">标题</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="title" data-rule="required;length[~15]" value="<?=$info['title']?>" >
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">摘要</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="summary" data-rule="required;length[~40]" value="<?=$info['summary']?>" >
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">封面</label>
                <div class="col-xs-6">
                	<?php if($info!=''){?>
                	<img src="<?=$info['img_url']?>" style="width:200px;">
                	<?php }?>
                    <input type="file" class="form-control" id="bp_cover" name="bp_cover" <?php if($info==''){?> data-rule="required;"<?php }?>>
                    <p class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：750X400px</p>
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">浏览量</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="fit" data-rule="required;integer[+]" value="<?=$info['fit']?>" >
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">点赞数</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="assist" data-rule="required;integer[+]" value="<?=$info['assist']?>" >
                </div>
            </div>
            <div class="form-group">
                <label for="bp_is_sell" class="col-xs-2 control-label">城市</label>
                <div class="col-xs-9">
                    {% if info['city_id'] == 0 %}
                        全国
                    {%else%}
                        {% for oc in openCity %}
                            {% if info['city_id'] == oc.city_id %}
                                {{oc.city_name}}
                            {%endif%}
                        {% endfor %}
                    {%endif%}
                </div>
            </div>

		<input type="hidden" name="id" value="<?=$info['id']?>">
        <div class="row form-group">
            <label class="col-xs-2 control-label">详情</label>
            <div class="col-xs-6">
                <script id="editor" name="content" type="text/plain" data-rule="required;"><?=$info['content']?></script>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-2 col-xs-10">
                <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 确 认</button>
            </div>
        </div>
    </form>
        </div>
</div>
        </div>
    </div>

        {% endblock %}
